from http.client import responses

import requests

from base.env_config import ENV


class BaseLogin(object):

    def _merchant_login(self):
        url = ENV.MER_POST + '/api/admin/merchant/login'
        headers = {
            'content-type': 'application/json',
            }

        json_data = {
            'account': ENV.MER_Username,
            'pwd': ENV.Mer_Password,
            'captchaVO': {},
            'captcha': {
                'captchaVerification': '',
                'secretKey': '',
                'token': '',
            },
        }
        return requests.post(url, json=json_data, headers=headers).json()["data"]["token"]

    def _user_login(self):
        return
    def _platform_login(self):
        return

if __name__ == '__main__':
    login = BaseLogin()
    token = login.merchant_login()
    print(token)
